package com.kcbsdk;

import android.util.Log;

import com.kcbsdk.MyManage.AGender;
import com.kcbsdk.MyRankBa.ACommentList;
import com.kcbsdk.MyRankBa.AObbligDetail;
import com.kcbsdk.MyRankBa.AObbligatoList;
import com.kcbsdk.MyRankBa.ARankTopList;
import com.kcbsdk.MyRankBa.ASongGiftList;
import com.kcbsdk.MyRankBa.ASongDetail;
import com.kcbsdk.MyRankBa.ASongList;
import com.kcbsdk.MyRankBa.AUserDetail;

/**
 * Created by Administrator on 2017/4/5.
 */

public class CSvrRankBa implements wpapper {
    public int g4EventMethod;
    public int g2LastDatabaseList;
    public int g4RankTopListCounter;
    public int g4Test_0x21 = 0x21;

    public int pollingEvent(){
        return g4EventMethod | cjmkcs.systemPollingEvent(tRANKBA, 0);
    }
    public void setMethodType(){
        cjmkcs.systemSetMethodType(tRANKBA | 0x00000001);
    }
    public int getMethodType(){
        return cjmkcs.systemSetMethodType(tRANKBA);
    }
    public String getMethodMessage(int type){
        return cjmkcs.systemGetMethodMessage(type);
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////
    public void fetchRankTopList(int cloudType, int readType, int areaData){
        cloudType |= g4Test_0x21;
        int g4Local_1 = (readType << 14) |  ((cloudType & 0x3f) << 8) | TOOLS_DBS_LIST_RANK_TOP;
//MSTRING(String.format("fetchRankTopList %08x %02x %02x", g4Local_1, cloudType, g4Test_0x21));
        cjmkcs.systemGetDatabaseList(g4Local_1, areaData, 0, 0, "", RANKBA_FETCH_DBS_LIST);
    }
    public ARankTopList[] methodRankTopDbs(int methodType, int areaData, int[] retMax){
        ARankTopList aRankTopList[] = null;
        int number = (methodType >> 16) & 0xff;
        int indexQty = cjmkcs.systemDatabaseListIndex(0, number, 0);
        if (indexQty > 0){
            aRankTopList = new ARankTopList[indexQty];
            retMax[0] = cjmkcs.systemDatabaseListIndex(1, number, 0);
            int g4Local_1;
            for (int counter = 0; counter < indexQty; counter++) {
                cjmkcs.systemDatabaseListIndex(2, number, counter);
                aRankTopList[counter] = new ARankTopList();
                aRankTopList[counter].UserID = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsUserID | number);
                aRankTopList[counter].SongID = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsSongID | number);
                g4Local_1 = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsAudioFlag | number);
                aRankTopList[counter].IsVideo = ((g4Local_1 & 0x01) > 0) ? true : false;
                aRankTopList[counter].IsChorus = ((g4Local_1 & 0x02) > 0) ? true : false;
                aRankTopList[counter].MemberLevel = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsMemberLevel | number);
                aRankTopList[counter].RichLevel = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsRichLevel | number);
                aRankTopList[counter].NickName = cjmkcs.systemGetWpapperString(wpRANKBA_DbsNickName | number);
                aRankTopList[counter].HeadFile = cjmkcs.systemGetWpapperString(wpRANKBA_DbsHeadFile | number);
                aRankTopList[counter].SongName = cjmkcs.systemGetWpapperString(wpRANKBA_DbsSongName | number);
            }
        }
        cjmkcs.systemDatabaseListIndex(3, number, 0);
        return aRankTopList;
    }
    public void fetchSongList(int cloudType, int readType, int userID){
        cloudType |= g4Test_0x21;
        int g4Local_1 = (readType << 14) |  ((cloudType & 0x3f) << 8) | TOOLS_DBS_LIST_CLOUD;
        cjmkcs.systemGetDatabaseList(g4Local_1, userID, 0, 0, "", RANKBA_FETCH_DBS_LIST);
    }
    public ASongList[] methodSongListDbs(int methodType, int userID, int[] retMax){
        ASongList[] aSongList = null;
        int number = (methodType >> 16) & 0xff;
        int indexQty = cjmkcs.systemDatabaseListIndex(0, number, 0);
        if (indexQty > 0){
            aSongList = new ASongList[indexQty];
            retMax[0] = cjmkcs.systemDatabaseListIndex(1, number, 0);
            for (int counter = 0; counter < indexQty; counter++) {
                cjmkcs.systemDatabaseListIndex(2, number, counter);
                aSongList[counter] = new ASongList();
                aSongList[counter].SongID = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsSongID | number);
                aSongList[counter].ReleaseDate = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsReleaseDate | number);
                aSongList[counter].IsVideo = ((cjmkcs.systemGetWpapperValue(wpRANKBA_DbsAudioFlag | number) & 0x01) > 0) ? true : false;
                aSongList[counter].AreaCode = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsAreaCode | number);
                aSongList[counter].RankHighes = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsRankHighes | number);
                aSongList[counter].CommentQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsCommentQty | number);
                aSongList[counter].ListenQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsListenQty | number);
                aSongList[counter].FlowerQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsFlowerQty | number);
                aSongList[counter].ShareQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsShareQty | number);
                aSongList[counter].CollectionQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsCollectionQty | number);
                aSongList[counter].SongName = cjmkcs.systemGetWpapperString(wpRANKBA_DbsSongName | number);
                aSongList[counter].ArtistName = cjmkcs.systemGetWpapperString(wpRANKBA_DbsArtistName | number);
                aSongList[counter].SongIntro = cjmkcs.systemGetWpapperString(wpRANKBA_DbsSongIntro | number);
//MDEBUG(0xd1);MSTRING(aSongList[counter].SongName);MSTRING(aSongList[counter].ArtistName);MSTRING(aSongList[counter].SongIntro);
            }
        }
        cjmkcs.systemDatabaseListIndex(3, number, 0);
        return aSongList;
    }

    public void fetchCommentList(int cloudType, int readType, int userID, int songID){
        cloudType |= g4Test_0x21;
        int g4Local_1 = (readType << 14) |  ((cloudType & 0x3f) << 8) | TOOLS_DBS_LIST_COMMENT;
        MSTRING(String.format("fetchCommentList %08x %d %d ", g4Local_1, userID, songID));
        cjmkcs.systemGetDatabaseList(g4Local_1, userID, songID, 0, "", RANKBA_FETCH_DBS_LIST);
    }
    public ACommentList[] methodCommentListDbs(int methodType, int userID, int songID, int[] retMax){
        ACommentList[] aCommentList = null;
        int number = (methodType >> 16) & 0xff;
        int indexQty = cjmkcs.systemDatabaseListIndex(0, number, 0);
        if (indexQty > 0){
            aCommentList = new ACommentList[20];
            retMax[0] = cjmkcs.systemDatabaseListIndex(1, number, 0);
            for (int counter = 0; counter < indexQty; counter++) {
                cjmkcs.systemDatabaseListIndex(2, number, counter);
                aCommentList[counter] = new ACommentList();
                aCommentList[counter].CommentID = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsCommentID | number);
                aCommentList[counter].CommentDate = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsCommentDate | number);
                aCommentList[counter].LikeQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsLikeQty | number);
                aCommentList[counter].ReplyQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsReplyQty | number);
                aCommentList[counter].UserID = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsUserID | number);
                aCommentList[counter].aGender = AGender.GENDER_GRIL;
                if (cjmkcs.systemGetWpapperValue(wpRANKBA_DbsFlag0 | number) == 1){
                    aCommentList[counter].aGender = AGender.GENDER_BOY;
                }
                aCommentList[counter].NickName = cjmkcs.systemGetWpapperString(wpRANKBA_DbsNickName | number);
                aCommentList[counter].Content = cjmkcs.systemGetWpapperString(wpRANKBA_DbsContent | number);
                aCommentList[counter].HeadFile = cjmkcs.systemGetWpapperString(wpRANKBA_DbsHeadFile | number);
            }
        }
        cjmkcs.systemDatabaseListIndex(3, number, 0);
        return aCommentList;
    }

    public void fetchSongGiftList(int cloudType, int readType, int userID, int songID){
        cloudType |= g4Test_0x21;
        int g4Local_1 = (readType << 14) |  ((cloudType & 0x3f) << 8) | TOOLS_DBS_LIST_SONG_GIFT;
        MSTRING(String.format("fetchSongGiftList %08x", g4Local_1));
        cjmkcs.systemGetDatabaseList(g4Local_1, userID, songID, 0, "", RANKBA_FETCH_DBS_LIST);
    }
    public ASongGiftList[] methodSongGiftListDbs(int methodType, int userID, int songID, int[] retMax){
        ASongGiftList[] aSongGiftList = null;
        int number = (methodType >> 16) & 0xff;
        int indexQty = cjmkcs.systemDatabaseListIndex(0, number, 0);
        if (indexQty > 0){
            aSongGiftList = new ASongGiftList[indexQty];
            retMax[0] = cjmkcs.systemDatabaseListIndex(1, number, 0);
            for (int counter = 0; counter < indexQty; counter++) {
                cjmkcs.systemDatabaseListIndex(2, number, counter);
                aSongGiftList[counter].UserID = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsUserID | number);
                aSongGiftList[counter].GiftQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsGiftQty | number);
                aSongGiftList[counter].FlowerQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsFlowerQty | number);
                aSongGiftList[counter].MoneyQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsMoneyQty | number);

                aSongGiftList[counter].HeadFile = cjmkcs.systemGetWpapperString(wpRANKBA_DbsHeadFile | number);
                aSongGiftList[counter].GiftFile = cjmkcs.systemGetWpapperString(wpRANKBA_DbsGiftFile | number);
            }
        }
        cjmkcs.systemDatabaseListIndex(3, number, 0);
        return aSongGiftList;
    }
    public void fetchObbligatoList(int cloudType, int readType, int styleID, String name){		// 歌曲伴奏
        cloudType |= g4Test_0x21;
        int g4Local_1 = (readType << 14) |  ((cloudType & 0x3f) << 8) | TOOLS_DBS_LIST_OBBLIGATO;
        cjmkcs.systemGetDatabaseList(g4Local_1, styleID, 0, 0, name, RANKBA_FETCH_DBS_LIST);
    }
    public AObbligatoList[] methodObbligatoListDbs(int methodType, int obbligatoType, int[] retMax){
        AObbligatoList[] aObbligatoList = null;
        int number = (methodType >> 16) & 0xff;
        int indexQty = cjmkcs.systemDatabaseListIndex(0, number, 0);
        if (indexQty > 0){
            aObbligatoList = new AObbligatoList[indexQty];
            retMax[0] = cjmkcs.systemDatabaseListIndex(1, number, 0);
            for (int counter = 0; counter < indexQty; counter++) {
                cjmkcs.systemDatabaseListIndex(2, number, counter);
                aObbligatoList[counter] = new AObbligatoList();
                aObbligatoList[counter].MusicID0 = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsMusicID0 | number);
                aObbligatoList[counter].MusicID1 = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsMusicID1 | number);
//MSTRING(String.format("methodObbligatoListDbs %d %d ", aObbligatoList[counter].MusicID0, aObbligatoList[counter].MusicID1));
                aObbligatoList[counter].FileSize = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsFileSize | number);
                aObbligatoList[counter].TimeLength = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsTimeLength | number);
                aObbligatoList[counter].HotValue = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsHotValue | number);
                aObbligatoList[counter].IsOther = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsFlag0 | number) > 0 ? true : false;

                aObbligatoList[counter].SongName = cjmkcs.systemGetWpapperString(wpRANKBA_DbsSongName | number);
                aObbligatoList[counter].ArtistName = cjmkcs.systemGetWpapperString(wpRANKBA_DbsArtistName | number);
                aObbligatoList[counter].SongTag = cjmkcs.systemGetWpapperString(wpRANKBA_DbsSongTag | number);
                aObbligatoList[counter].IconFile = cjmkcs.systemGetWpapperString(wpRANKBA_DbsIconFile | number);
//MSTRING(String.format("methodObbligatoListDbs %s %s %s %s ", aObbligatoList[counter].SongName, aObbligatoList[counter].ArtistName, aObbligatoList[counter].SongTag, aObbligatoList[counter].IconFile));
            }
        }
        cjmkcs.systemDatabaseListIndex(3, number, 0);
        return aObbligatoList;
    }
    public void fetchUserExtrList(int cloudType, int readType, int extrType, int userID){		// 扩展信息
//        cloudType |= g4Test_0x21;
//        int dbsType = TOOLS_DBS_LIST_PHOTO;
//        switch (extrType){
//            case TOOLS_LIST_EXTR_CARE : dbsType = TOOLS_DBS_LIST_CARE; break;
//            case TOOLS_LIST_EXTR_FANS : dbsType = TOOLS_DBS_LIST_FANS; break;
//        }
//        int g4Local_1 = (readType << 14) |  ((cloudType & 0x3f) << 8) | dbsType;
//        cjmkcs.systemGetDatabaseList(g4Local_1, userID, extrType, 0, "", "", RANKBA_FETCH_USER_EXTR_LIST);
    }

    ////////////////////////////////////////////////////////////////////////////////////////////////



    public void fetchUserDetail(int cloudType, int userID, int readType){
        cloudType |= g4Test_0x21;
        readType = (readType << 14) & 0xc000;
        cjmkcs.rankbaFetchUserDetail(readType | (cloudType << 8) | TOOLS_DBS_LIST_USER_DETAIL, userID, RANKBA_FETCH_USER_DETAIL);
    }
    public AUserDetail methodFetchUserDetail(int methodType){
        int readType = (methodType >> 14) & 0x03;
        int number = (methodType >> 16) & 0xff;
        cjmkcs.systemDatabaseListIndex(2, number, 0);
        AUserDetail aUserDetail = new AUserDetail();
        aUserDetail.UserID = cjmkcs.systemGetWpapperValue(wpTOOLS_DbsHeadMainID | number);
        aUserDetail.AreaCode = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsAreaCode | number);
//        aUserDetail.Birthday = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsB | number);
        aUserDetail.SongQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsSongQty | number);
        aUserDetail.PhotoQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsPhotoQty | number);
        aUserDetail.ListenQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsListenQty | number);
        aUserDetail.FansQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsFansQty | number);
        aUserDetail.CareQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsCareQty | number);
        aUserDetail.NoticeQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsNoticeQty | number);
        aUserDetail.CollectQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsCollectQty | number);
        int g4Local_1 = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsFlag0) ;
        aUserDetail.aGender = AGender.GENDER_GRIL;
        if ((g4Local_1 & 0x01) > 0){
            aUserDetail.aGender = AGender.GENDER_BOY;
        }
        aUserDetail.Birthday = g4Local_1 >> 8;
        aUserDetail.NickName = cjmkcs.systemGetWpapperString(wpRANKBA_DbsNickName | number);
        aUserDetail.Intro = cjmkcs.systemGetWpapperString(wpRANKBA_DbsUserIntro | number);
        aUserDetail.HeadFile = cjmkcs.systemGetWpapperString(wpRANKBA_DbsPinYin | number);
        if ((readType & 0x01) > 0){
            aUserDetail.HeadFile = cjmkcs.systemGetWpapperString(wpRANKBA_DbsHeadFile | number);
        }
        if ((readType & 0x02) > 0){
            aUserDetail.BackGndFile = cjmkcs.systemGetWpapperString(wpRANKBA_DbsBackGndFile | number);
        }
        cjmkcs.systemDatabaseListIndex(3, number, 0);
        return aUserDetail;
    }
    public void fetchSongDetail(int cloudType, int userID, int songID){
        cloudType |= g4Test_0x21;
        cjmkcs.rankbaFetchSongDetail((cloudType << 8) | TOOLS_DBS_LIST_SONG_DETAIL, userID, songID, RANKBA_FETCH_SONG_DETAIL);
    }

    public ASongDetail methodFetchSongDetail(int methodType){
        int number = (methodType >> 16) & 0xff;
        cjmkcs.systemDatabaseListIndex(2, number, 0);
        ASongDetail aSongDetail = new ASongDetail();
        aSongDetail.UserID = cjmkcs.systemGetWpapperValue(wpTOOLS_DbsHeadMainID);
        aSongDetail.SongID = cjmkcs.systemGetWpapperValue(wpTOOLS_DbsHeadSubID);
        aSongDetail.MusicID0 = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsMusicID0 | number);
        aSongDetail.MusicID1 = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsMusicID1 | number);
        aSongDetail.HotValue = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsHotValue | number);
        aSongDetail.IsVideo = (cjmkcs.systemGetWpapperValue(wpRANKBA_DbsFlag0 | number) > 0) ? true : false;
        aSongDetail.ReleaseDate = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsReleaseDate | number);
        aSongDetail.RankHighes = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsRankHighes | number);

        aSongDetail.CommentQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsCommentQty | number);
        aSongDetail.ListenQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsListenQty | number);
        aSongDetail.FlowerQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsFlowerQty | number);
        aSongDetail.ShareQty = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsShareQty | number);

        aSongDetail.AudioFile = cjmkcs.systemGetWpapperString(wpRANKBA_DbsAudioFile | number);
        aSongDetail.VideoFile = cjmkcs.systemGetWpapperString(wpRANKBA_DbsVideoFile | number);
        aSongDetail.SongName = cjmkcs.systemGetWpapperString(wpRANKBA_DbsSongName | number);
        //MSTRING("aSongInfo.SongName "+aSongInfo.SongName);
        aSongDetail.ArtistName = cjmkcs.systemGetWpapperString(wpRANKBA_DbsArtistName | number);
        aSongDetail.SongIntro = cjmkcs.systemGetWpapperString(wpRANKBA_DbsSongIntro | number);
        cjmkcs.systemDatabaseListIndex(3, number, 0);
        return aSongDetail;
    }
    public void fetchSongFile(int cloudType, int userID, int songID, boolean video){
        cloudType |= g4Test_0x21;
        int g4Local_1 = video ? 1 : 0;
        cjmkcs.rankbaFetchSongFile(RANKBA_FETCH_SONG_FILE | (cloudType << 8) | g4Local_1, userID, songID, RANKBA_FETCH_SONG_FILE);
    }

    ////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////
    public void eventDownloadAudio(int[] retValue) {
        cjmkcs.systemClearEvent(tRANKBA, RANKBA_EVENT_DOWN_AUDIO_FILE, 0);
        retValue[0] = cjmkcs.systemGetWpapperValue(wpRANKBA_DownAudioCounter);
        retValue[1] = cjmkcs.systemGetWpapperValue(wpRANKBA_DownAudioLength);
        g4EventMethod |= RANKBA_EVENT_DOWN_AUDIO_FILE;
    }
    public void eventDownloadVideo(int[] retValue) {
        cjmkcs.systemClearEvent(tRANKBA, RANKBA_EVENT_DOWN_VIDEO_FILE, 0);
        retValue[0] = cjmkcs.systemGetWpapperValue(wpRANKBA_DownVideoCounter);
        retValue[1] = cjmkcs.systemGetWpapperValue(wpRANKBA_DownVideoLength);
        g4EventMethod |= RANKBA_EVENT_DOWN_VIDEO_FILE;
    }

    public void fetchObbligDetail(int cloudType, int musicID0, int musicID1){
        cloudType |= g4Test_0x21;
        cjmkcs.rankbaFetchObbligDetail(TOOLS_DBS_LIST_OBB_DETAIL | (cloudType << 8), musicID0, musicID1, RANKBA_FETCH_OBBLIG_DETAIL);
    }
    public AObbligDetail methodFetchObbligDetail(int methodType){
        int number = (methodType >> 16) & 0xff;
        MSTRING(String.format("methodFetchObbligDetail A %08x %d", methodType, number));
        cjmkcs.systemDatabaseListIndex(2, number, 0);
        AObbligDetail aObbligDetail = new AObbligDetail();
        aObbligDetail.MusicID0 = cjmkcs.systemGetWpapperValue(wpTOOLS_DbsHeadMainID);
        aObbligDetail.MusicID1 = cjmkcs.systemGetWpapperValue(wpTOOLS_DbsHeadSubID);
        aObbligDetail.SrcID0 = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsMusicID0);
        aObbligDetail.SrcID1 = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsMusicID1);
        aObbligDetail.FileSize = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsAudioLength | number);
        aObbligDetail.TimeLength = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsTimeLength | number);
        aObbligDetail.AreaCode = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsAreaCode | number);
        aObbligDetail.ReleaseDate = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsReleaseDate | number);
        aObbligDetail.RankHighes = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsRankHighes | number);
        aObbligDetail.HotValue = cjmkcs.systemGetWpapperValue(wpRANKBA_DbsHotValue | number);

        aObbligDetail.SongName = cjmkcs.systemGetWpapperString(wpRANKBA_DbsSongName | number);
        aObbligDetail.ArtistName = cjmkcs.systemGetWpapperString(wpRANKBA_DbsArtistName | number);
        aObbligDetail.UploaderNmae = cjmkcs.systemGetWpapperString(wpRANKBA_DbsNickName | number);
        aObbligDetail.PinYin = cjmkcs.systemGetWpapperString(wpRANKBA_DbsPinYin | number);
        aObbligDetail.AudioFile = cjmkcs.systemGetWpapperString(wpRANKBA_DbsAudioFile | number);
        aObbligDetail.ObbligFile = cjmkcs.systemGetWpapperString(wpRANKBA_DbsObbligFile | number);
        aObbligDetail.IconFile = cjmkcs.systemGetWpapperString(wpRANKBA_DbsIconFile | number);
        aObbligDetail.UploaderFile = cjmkcs.systemGetWpapperString(wpRANKBA_DbsHeadFile | number);
MSTRING(String.format("methodFetchSongDetail B %d %d %d %d ", aObbligDetail.MusicID0, aObbligDetail.MusicID1, aObbligDetail.SrcID0, aObbligDetail.SrcID1));
MSTRING(String.format("methodFetchSongDetail %s %s %s %s ", aObbligDetail.SongName, aObbligDetail.ArtistName, aObbligDetail.SongTag, aObbligDetail.IconFile));

        cjmkcs.systemDatabaseListIndex(3, number, 0);
        return aObbligDetail;
    }

    public void eventDownImgSmall(){
        cjmkcs.systemClearEvent(tRANKBA, RANKBA_EVENT_NEW_IMG_SMALL, 0);
        g4EventMethod |= RANKBA_EVENT_NEW_IMG_SMALL;
    }
    public void eventDownImgMiddle(){
        cjmkcs.systemClearEvent(tRANKBA, RANKBA_EVENT_NEW_IMG_MIDDLE, 0);
        g4EventMethod |= RANKBA_EVENT_NEW_IMG_MIDDLE;
    }
    public void eventDownImgLarge(){
        cjmkcs.systemClearEvent(tRANKBA, RANKBA_EVENT_NEW_IMG_LARGE, 0);
        g4EventMethod |= RANKBA_EVENT_NEW_IMG_LARGE;
    }
    public void eventDownImgRank(){
        cjmkcs.systemClearEvent(tRANKBA, RANKBA_EVENT_NEW_IMG_RANK, 0);
        g4EventMethod |= RANKBA_EVENT_NEW_IMG_RANK;
    }





    public void MSTRING(String text){
        Log.d("MSYS", text);
    }
}
